New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes/new headless mode in chrome #3581
Fixes/new headless mode in chrome #3581
Conversation
@@ -328,7 +328,7 @@ module.exports = class SeleniumCapabilities { | |||
|
|||
addHeadlessOption({options}) { | |||
if (this.argv.headless && (options instanceof Capabilities) && (this.isChrome || options.headless)) { | |||
this.isChrome ? options.addArguments('headless=chrome') : options.headless(); | |||
this.isChrome ? options.addArguments('headless=new') : options.headless(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the older versions of Chrome browser? Would --headless=new
work with them as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to detect the version of the chrome browser before the driver creation. And people using older version of chrome will likely be using older version of nightwatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should tag this as a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we can also detect the version of chromedriver
, right? Since chromedriver version == chrome version.
(Of course, only if it is worth doing. But I guess we can also pass the --headless=chrome
argument directly in desired capabilities and it will work for older chrome versions?)
Changes
--headless=new
from--headless=chrome
according to the recent change in chrome. For more details refer this issue